<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="BaseItemDataSet" targetNamespace="http://tempuri.org/BaseItemDataSet.xsd" xmlns:mstns="http://tempuri.org/BaseItemDataSet.xsd" xmlns="http://tempuri.org/BaseItemDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="1" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="SocialNetworkConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="SocialNetworkConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.WLQuickApps.SocialNetwork.Data.Properties.Settings.GlobalReference.Default.SocialNetworkConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="BaseItemTableAdapter" GeneratorDataComponentClassName="BaseItemTableAdapter" Name="BaseItem" UserDataComponentName="BaseItemTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="SocialNetwork.dbo.BaseItem" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>DELETE FROM [BaseItem] WHERE (([BaseItemID] = @Original_BaseItemID) AND ([ItemType] = @Original_ItemType) AND ([LocationID] = @Original_LocationID) AND ([TotalViews] = @Original_TotalViews) AND ([TotalRatingScore] = @Original_TotalRatingScore) AND ([TotalRatingCount] = @Original_TotalRatingCount) AND ((@IsNull_AverageRating = 1 AND [AverageRating] IS NULL) OR ([AverageRating] = @Original_AverageRating)) AND ([Title] = @Original_Title) AND ([OwnerUserID] = @Original_OwnerUserID) AND ([CreateDate] = @Original_CreateDate) AND ([SubType] = @Original_SubType) AND ([PrivacyLevel] = @Original_PrivacyLevel) AND ([IsApproved] = @Original_IsApproved) AND ((@IsNull_ImageURL = 1 AND [ImageURL] IS NULL) OR ([ImageURL] = @Original_ImageURL)))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_BaseItemID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ItemType" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ItemType" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_LocationID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="LocationID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_TotalViews" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TotalViews" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Double" Direction="Input" ParameterName="@Original_TotalRatingScore" Precision="0" ProviderType="Float" Scale="0" Size="0" SourceColumn="TotalRatingScore" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_TotalRatingCount" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TotalRatingCount" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_AverageRating" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="AverageRating" SourceColumnNullMapping="true" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Double" Direction="Input" ParameterName="@Original_AverageRating" Precision="0" ProviderType="Float" Scale="0" Size="0" SourceColumn="AverageRating" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Original_Title" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Title" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_OwnerUserID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="OwnerUserID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="DateTime" Direction="Input" ParameterName="@Original_CreateDate" Precision="0" ProviderType="DateTime" Scale="0" Size="0" SourceColumn="CreateDate" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_SubType" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="SubType" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_PrivacyLevel" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="PrivacyLevel" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_IsApproved" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsApproved" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_ImageURL" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ImageURL" SourceColumnNullMapping="true" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ImageURL" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ImageURL" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>INSERT INTO [BaseItem] ([ItemType], [TagList], [LocationID], [TotalViews], [TotalRatingScore], [TotalRatingCount], [AverageRating], [Title], [Description], [OwnerUserID], [CreateDate], [SubType], [PrivacyLevel], [IsApproved], [ImageURL]) VALUES (@ItemType, @TagList, @LocationID, @TotalViews, @TotalRatingScore, @TotalRatingCount, @AverageRating, @Title, @Description, @OwnerUserID, @CreateDate, @SubType, @PrivacyLevel, @IsApproved, @ImageURL);
SELECT BaseItemID, ItemType, TagList, LocationID, TotalViews, TotalRatingScore, TotalRatingCount, AverageRating, Title, Description, OwnerUserID, CreateDate, SubType, PrivacyLevel, IsApproved, ImageURL FROM BaseItem WHERE (BaseItemID = SCOPE_IDENTITY())</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ItemType" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ItemType" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@TagList" Precision="0" ProviderType="Text" Scale="0" Size="0" SourceColumn="TagList" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@LocationID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="LocationID" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@TotalViews" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TotalViews" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Double" Direction="Input" ParameterName="@TotalRatingScore" Precision="0" ProviderType="Float" Scale="0" Size="0" SourceColumn="TotalRatingScore" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@TotalRatingCount" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TotalRatingCount" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Double" Direction="Input" ParameterName="@AverageRating" Precision="0" ProviderType="Float" Scale="0" Size="0" SourceColumn="AverageRating" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Title" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Title" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Description" Precision="0" ProviderType="NText" Scale="0" Size="0" SourceColumn="Description" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@OwnerUserID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="OwnerUserID" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="DateTime" Direction="Input" ParameterName="@CreateDate" Precision="0" ProviderType="DateTime" Scale="0" Size="0" SourceColumn="CreateDate" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@SubType" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="SubType" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@PrivacyLevel" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="PrivacyLevel" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@IsApproved" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsApproved" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ImageURL" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ImageURL" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        BaseItemID, ItemType, TagList, LocationID, TotalViews, TotalRatingScore, TotalRatingCount, AverageRating, Title, Description, OwnerUserID, CreateDate, 
                         SubType, PrivacyLevel, IsApproved, ImageURL
FROM            BaseItem</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>UPDATE [BaseItem] SET [ItemType] = @ItemType, [TagList] = @TagList, [LocationID] = @LocationID, [TotalViews] = @TotalViews, [TotalRatingScore] = @TotalRatingScore, [TotalRatingCount] = @TotalRatingCount, [AverageRating] = @AverageRating, [Title] = @Title, [Description] = @Description, [OwnerUserID] = @OwnerUserID, [CreateDate] = @CreateDate, [SubType] = @SubType, [PrivacyLevel] = @PrivacyLevel, [IsApproved] = @IsApproved, [ImageURL] = @ImageURL WHERE (([BaseItemID] = @Original_BaseItemID) AND ([ItemType] = @Original_ItemType) AND ([LocationID] = @Original_LocationID) AND ([TotalViews] = @Original_TotalViews) AND ([TotalRatingScore] = @Original_TotalRatingScore) AND ([TotalRatingCount] = @Original_TotalRatingCount) AND ((@IsNull_AverageRating = 1 AND [AverageRating] IS NULL) OR ([AverageRating] = @Original_AverageRating)) AND ([Title] = @Original_Title) AND ([OwnerUserID] = @Original_OwnerUserID) AND ([CreateDate] = @Original_CreateDate) AND ([SubType] = @Original_SubType) AND ([PrivacyLevel] = @Original_PrivacyLevel) AND ([IsApproved] = @Original_IsApproved) AND ((@IsNull_ImageURL = 1 AND [ImageURL] IS NULL) OR ([ImageURL] = @Original_ImageURL)));
SELECT BaseItemID, ItemType, TagList, LocationID, TotalViews, TotalRatingScore, TotalRatingCount, AverageRating, Title, Description, OwnerUserID, CreateDate, SubType, PrivacyLevel, IsApproved, ImageURL FROM BaseItem WHERE (BaseItemID = @BaseItemID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ItemType" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ItemType" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@TagList" Precision="0" ProviderType="Text" Scale="0" Size="0" SourceColumn="TagList" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@LocationID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="LocationID" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@TotalViews" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TotalViews" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Double" Direction="Input" ParameterName="@TotalRatingScore" Precision="0" ProviderType="Float" Scale="0" Size="0" SourceColumn="TotalRatingScore" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@TotalRatingCount" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TotalRatingCount" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Double" Direction="Input" ParameterName="@AverageRating" Precision="0" ProviderType="Float" Scale="0" Size="0" SourceColumn="AverageRating" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Title" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Title" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Description" Precision="0" ProviderType="NText" Scale="0" Size="0" SourceColumn="Description" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@OwnerUserID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="OwnerUserID" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="DateTime" Direction="Input" ParameterName="@CreateDate" Precision="0" ProviderType="DateTime" Scale="0" Size="0" SourceColumn="CreateDate" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@SubType" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="SubType" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@PrivacyLevel" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="PrivacyLevel" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@IsApproved" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsApproved" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@ImageURL" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ImageURL" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_BaseItemID" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ItemType" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ItemType" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_LocationID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="LocationID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_TotalViews" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TotalViews" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Double" Direction="Input" ParameterName="@Original_TotalRatingScore" Precision="0" ProviderType="Float" Scale="0" Size="0" SourceColumn="TotalRatingScore" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_TotalRatingCount" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TotalRatingCount" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_AverageRating" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="AverageRating" SourceColumnNullMapping="true" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Double" Direction="Input" ParameterName="@Original_AverageRating" Precision="0" ProviderType="Float" Scale="0" Size="0" SourceColumn="AverageRating" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@Original_Title" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumn="Title" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Guid" Direction="Input" ParameterName="@Original_OwnerUserID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="0" SourceColumn="OwnerUserID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="DateTime" Direction="Input" ParameterName="@Original_CreateDate" Precision="0" ProviderType="DateTime" Scale="0" Size="0" SourceColumn="CreateDate" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_SubType" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="SubType" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_PrivacyLevel" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="PrivacyLevel" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Boolean" Direction="Input" ParameterName="@Original_IsApproved" Precision="0" ProviderType="Bit" Scale="0" Size="0" SourceColumn="IsApproved" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_ImageURL" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="ImageURL" SourceColumnNullMapping="true" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_ImageURL" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="ImageURL" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="BaseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@BaseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="BaseItemID" DataSetColumn="BaseItemID" />
              <Mapping SourceColumn="ItemType" DataSetColumn="ItemType" />
              <Mapping SourceColumn="TagList" DataSetColumn="TagList" />
              <Mapping SourceColumn="LocationID" DataSetColumn="LocationID" />
              <Mapping SourceColumn="TotalViews" DataSetColumn="TotalViews" />
              <Mapping SourceColumn="TotalRatingScore" DataSetColumn="TotalRatingScore" />
              <Mapping SourceColumn="TotalRatingCount" DataSetColumn="TotalRatingCount" />
              <Mapping SourceColumn="AverageRating" DataSetColumn="AverageRating" />
              <Mapping SourceColumn="Title" DataSetColumn="Title" />
              <Mapping SourceColumn="Description" DataSetColumn="Description" />
              <Mapping SourceColumn="OwnerUserID" DataSetColumn="OwnerUserID" />
              <Mapping SourceColumn="CreateDate" DataSetColumn="CreateDate" />
              <Mapping SourceColumn="SubType" DataSetColumn="SubType" />
              <Mapping SourceColumn="PrivacyLevel" DataSetColumn="PrivacyLevel" />
              <Mapping SourceColumn="IsApproved" DataSetColumn="IsApproved" />
              <Mapping SourceColumn="ImageURL" DataSetColumn="ImageURL" />
            </Mappings>
            <Sources>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="AddThumbnailToCache" Modifier="Public" Name="AddThumbnailToCache" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy" UserSourceName="AddThumbnailToCache">
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>DELETE FROM ThumbnailCache
WHERE BaseItemID = @baseItemID AND MaximumWidth = @maximumWidth
AND MaximumHeight = @maximumHeight;

INSERT INTO ThumbnailCache (BaseItemID, Bits, MaximumWidth, MaximumHeight, LastAccessedDate)
VALUES (@baseItemID, @bits, @maximumWidth, @maximumHeight, CURRENT_TIMESTAMP);</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="[SocialNetwork].dbo.ThumbnailCache" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="maximumWidth" ColumnName="MaximumWidth" DataSourceName="[SocialNetwork].dbo.ThumbnailCache" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@maximumWidth" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="MaximumWidth" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="maximumHeight" ColumnName="MaximumHeight" DataSourceName="[SocialNetwork].dbo.ThumbnailCache" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@maximumHeight" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="MaximumHeight" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="bits" ColumnName="Bits" DataSourceName="[SocialNetwork].dbo.ThumbnailCache" DataTypeServer="image" DbType="Binary" Direction="Input" ParameterName="@bits" Precision="0" ProviderType="Image" Scale="0" Size="2147483647" SourceColumn="Bits" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="ApproveBaseItem" Modifier="Public" Name="ApproveBaseItem" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy1" UserSourceName="ApproveBaseItem">
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>UPDATE [BaseItem] SET [IsApproved] = 'True' WHERE [BaseItemID] = @baseItemID</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="AssociateBaseItemWithBaseItem" Modifier="Public" Name="AssociateBaseItemWithBaseItem" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy2" UserSourceName="AssociateBaseItemWithBaseItem">
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>INSERT INTO BaseItemAssociation
                         (AssociatedBaseItemID, BaseItemID)
VALUES        (@associatedBaseItemID,@baseItemID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="associatedBaseItemID" ColumnName="AssociatedBaseItemID" DataSourceName="SocialNetwork.dbo.BaseItemAssociation" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@associatedBaseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="AssociatedBaseItemID" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.BaseItemAssociation" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorGetMethodName="GetDataBy3" GeneratorSourceName="CreateBaseItem" Modifier="Public" Name="CreateBaseItem" QueryType="Scalar" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy3" UserSourceName="CreateBaseItem">
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>INSERT INTO [BaseItem] ([ItemType], [TagList], [LocationID], [TotalViews], [TotalRatingScore], [TotalRatingCount], [Title], [Description], [OwnerUserID], [CreateDate], [SubType], [PrivacyLevel], [IsApproved], [ImageURL]) VALUES (@ItemType, @TagList, @LocationID, @TotalViews, @TotalRatingScore, @TotalRatingCount, @Title, @Description, @OwnerUserID, @CreateDate, @SubType, @PrivacyLevel, @IsApproved, @ImageURL);
SELECT SCOPE_IDENTITY()</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="ItemType" ColumnName="ItemType" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@ItemType" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="ItemType" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="TagList" ColumnName="TagList" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="text" DbType="AnsiString" Direction="Input" ParameterName="@TagList" Precision="0" ProviderType="Text" Scale="0" Size="2147483647" SourceColumn="TagList" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="LocationID" ColumnName="LocationID" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@LocationID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="LocationID" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="TotalViews" ColumnName="TotalViews" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@TotalViews" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="TotalViews" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="TotalRatingScore" ColumnName="TotalRatingScore" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="float" DbType="Double" Direction="Input" ParameterName="@TotalRatingScore" Precision="0" ProviderType="Float" Scale="0" Size="8" SourceColumn="TotalRatingScore" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="TotalRatingCount" ColumnName="TotalRatingCount" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@TotalRatingCount" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="TotalRatingCount" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="Title" ColumnName="Title" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="nvarchar(255)" DbType="String" Direction="Input" ParameterName="@Title" Precision="0" ProviderType="NVarChar" Scale="0" Size="255" SourceColumn="Title" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="Description" ColumnName="Description" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="ntext" DbType="String" Direction="Input" ParameterName="@Description" Precision="0" ProviderType="NText" Scale="0" Size="1073741823" SourceColumn="Description" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="OwnerUserID" ColumnName="OwnerUserID" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@OwnerUserID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="OwnerUserID" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="CreateDate" ColumnName="CreateDate" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@CreateDate" Precision="0" ProviderType="DateTime" Scale="0" Size="8" SourceColumn="CreateDate" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="SubType" ColumnName="SubType" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@SubType" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="SubType" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="PrivacyLevel" ColumnName="PrivacyLevel" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@PrivacyLevel" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="PrivacyLevel" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="IsApproved" ColumnName="IsApproved" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="bit" DbType="Boolean" Direction="Input" ParameterName="@IsApproved" Precision="0" ProviderType="Bit" Scale="0" Size="1" SourceColumn="IsApproved" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="ImageURL" ColumnName="ImageURL" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="varchar(255)" DbType="AnsiString" Direction="Input" ParameterName="@ImageURL" Precision="0" ProviderType="VarChar" Scale="0" Size="255" SourceColumn="ImageURL" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="DeleteAllBaseItemsForUser" Modifier="Public" Name="DeleteAllBaseItemsForUser" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy4" UserSourceName="DeleteAllBaseItemsForUser">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>DELETE FROM [BaseItem] WHERE OwnerUserID = @ownerUserID</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="ownerUserID" ColumnName="OwnerUserID" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@ownerUserID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="OwnerUserID" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="DeleteBaseItem" Modifier="Public" Name="DeleteBaseItem" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy5" UserSourceName="DeleteBaseItem">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>DELETE FROM [BaseItem] WHERE [BaseItemID] = @baseItemID</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="[SocialNetwork].dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="SocialNetwork.dbo.BaseItem" DbObjectType="Table" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="GetAssociatedBaseItemsByBaseItemID" GetMethodModifier="Public" GetMethodName="GetAssociatedBaseItemsByBaseItemID" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetAssociatedBaseItemsByBaseItemID" UserSourceName="GetAssociatedBaseItemsByBaseItemID">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT BaseItem.AverageRating, BaseItem.BaseItemID, BaseItem.CreateDate, BaseItem.Description, BaseItem.ImageURL, BaseItem.IsApproved, BaseItem.ItemType, BaseItem.LocationID, BaseItem.OwnerUserID, BaseItem.PrivacyLevel, BaseItem.SubType, BaseItem.TagList, BaseItem.Title, BaseItem.TotalRatingCount, BaseItem.TotalRatingScore, BaseItem.TotalViews, BaseItem.ImageURL

FROM BaseItem INNER JOIN BaseItemAssociation ON BaseItem.BaseItemID = BaseItemAssociation.AssociatedBaseItemID WHERE (BaseItemAssociation.BaseItemID = @baseItemID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.BaseItemAssociation" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="SocialNetwork.dbo.BaseItem" DbObjectType="Table" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="GetBaseItemByBaseItemID" GetMethodModifier="Public" GetMethodName="GetBaseItemByBaseItemID" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetBaseItemByBaseItemID" UserSourceName="GetBaseItemByBaseItemID">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT AverageRating, BaseItemID, CreateDate, Description, ImageURL, IsApproved, ItemType, LocationID, OwnerUserID, PrivacyLevel, SubType, TagList, Title, TotalRatingCount, TotalRatingScore, TotalViews FROM BaseItem WHERE (BaseItemID = @baseItemID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="SocialNetwork.dbo.BaseItem" DbObjectType="Table" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="GetBaseItemsAssociatedWithBaseItem" GeneratorSourceName="FillBy" GetMethodModifier="Public" GetMethodName="GetBaseItemsAssociatedWithBaseItem" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetBaseItemsAssociatedWithBaseItem" UserSourceName="GetBaseItemsAssociatedWithBaseItem">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT BaseItem.AverageRating, BaseItem.BaseItemID, BaseItem.CreateDate, BaseItem.Description, BaseItem.ImageURL, BaseItem.IsApproved, BaseItem.ItemType, BaseItem.LocationID, BaseItem.OwnerUserID, BaseItem.PrivacyLevel, BaseItem.SubType, BaseItem.TagList, BaseItem.Title, BaseItem.TotalRatingCount, BaseItem.TotalRatingScore, BaseItem.TotalViews FROM BaseItem INNER JOIN BaseItemAssociation ON BaseItem.BaseItemID = BaseItemAssociation.BaseItemID WHERE (BaseItemAssociation.AssociatedBaseItemID = @associatedBaseItemID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="associatedBaseItemID" ColumnName="AssociatedBaseItemID" DataSourceName="SocialNetwork.dbo.BaseItemAssociation" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@associatedBaseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="AssociatedBaseItemID" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="SocialNetwork.dbo.BaseItem" DbObjectType="Table" GenerateShortCommands="true" GeneratorSourceName="GetItemType" Modifier="Public" Name="GetItemType" QueryType="Scalar" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy6" UserSourceName="GetItemType">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT AverageRating, BaseItemID, CreateDate, Description, IsApproved, ItemType, LocationID, OwnerUserID, PrivacyLevel, SubType, TagList, Title, TotalRatingCount, TotalRatingScore, TotalViews, ImageURL FROM BaseItem WHERE (BaseItemID = @baseItemID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="SocialNetwork.dbo.BaseItem" DbObjectType="Table" GenerateShortCommands="true" GeneratorSourceName="GetRating" Modifier="Public" Name="GetRating" QueryType="Scalar" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy7" UserSourceName="GetRating">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT AverageRating, BaseItemID, CreateDate, Description, IsApproved, ItemType, LocationID, OwnerUserID, PrivacyLevel, SubType, TagList, Title, TotalRatingCount, TotalRatingScore, TotalViews, ImageURL FROM BaseItem WHERE (BaseItemID = @baseItemID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="[SocialNetwork].dbo.BaseItem" DbObjectType="Table" GenerateShortCommands="true" GeneratorSourceName="GetRawThumbnailBits" Modifier="Public" Name="GetRawThumbnailBits" QueryType="Scalar" ScalarCallRetval="System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy8" UserSourceName="GetRawThumbnailBits">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT ThumbnailBits FROM BaseItem WHERE (BaseItemID = @baseItemID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="[SocialNetwork].dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="GetThumbnail" Modifier="Public" Name="GetThumbnail" QueryType="Scalar" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy9" UserSourceName="GetThumbnail">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>UPDATE ThumbnailCache
SET LastAccessedDate = CURRENT_TIMESTAMP
WHERE BaseItemID = @baseItemID AND MaximumWidth = @maximumWidth
AND MaximumHeight = @maximumHeight;

SELECT Bits FROM ThumbnailCache
WHERE BaseItemID = @baseItemID AND MaximumWidth = @maximumWidth
AND MaximumHeight = @maximumHeight</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="[SocialNetwork].dbo.ThumbnailCache" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="maximumWidth" ColumnName="MaximumWidth" DataSourceName="[SocialNetwork].dbo.ThumbnailCache" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@maximumWidth" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="MaximumWidth" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="maximumHeight" ColumnName="MaximumHeight" DataSourceName="[SocialNetwork].dbo.ThumbnailCache" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@maximumHeight" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="MaximumHeight" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="SocialNetwork.dbo.BaseItem" DbObjectType="Table" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="GetUnapprovedBaseItems" GetMethodModifier="Public" GetMethodName="GetUnapprovedBaseItems" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetUnapprovedBaseItems" UserSourceName="GetUnapprovedBaseItems">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT TOP (100) AverageRating, BaseItemID, CreateDate, Description, ImageURL, IsApproved, ItemType, LocationID, OwnerUserID, PrivacyLevel, SubType, TagList, Title, TotalRatingCount, TotalRatingScore, TotalViews , ImageURL FROM BaseItem WHERE (IsApproved = 'false') ORDER BY BaseItemID</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="GetUnapprovedBaseItemsCount" Modifier="Public" Name="GetUnapprovedBaseItemsCount" QueryType="Scalar" ScalarCallRetval="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy10" UserSourceName="GetUnapprovedBaseItemsCount">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT       Count(*)
FROM            BaseItem 
WHERE        (BaseItem.IsApproved = 'false')</CommandText>
                    <Parameters />
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="RateItem" Modifier="Public" Name="RateItem" QueryType="Scalar" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy11" UserSourceName="RateItem">
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>DELETE FROM UserBaseItemRating
WHERE UserID = @userID AND BaseItemID = @baseItemID;

INSERT INTO UserBaseItemRating (UserID, BaseItemID, Rating)
VALUES (@userID, @baseItemID, @rating);

UPDATE BaseItem
SET TotalRatingScore = (SELECT SUM(Rating) FROM UserBaseItemRating WHERE BaseItemID = @baseItemID),
TotalRatingCount = (SELECT COUNT(Rating) FROM UserBaseItemRating WHERE BaseItemID = @baseItemID)
WHERE BaseItemID = @baseItemID;

SELECT AverageRating
FROM BaseItem
WHERE BaseItemID = @baseItemID</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="userID" ColumnName="UserID" DataSourceName="SocialNetwork.dbo.UserBaseItemRating" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@userID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="UserID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.UserBaseItemRating" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="rating" ColumnName="Rating" DataSourceName="SocialNetwork.dbo.UserBaseItemRating" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@rating" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="Rating" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="RemoveAssociatedBaseItemAssociations" Modifier="Public" Name="RemoveAssociatedBaseItemAssociations" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy12" UserSourceName="RemoveAssociatedBaseItemAssociations">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>DELETE FROM BaseItemAssociation
WHERE        (AssociatedBaseItemID = @associatedBaseItemID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="associatedBaseItemID" ColumnName="AssociatedBaseItemID" DataSourceName="SocialNetwork.dbo.BaseItemAssociation" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@associatedBaseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="AssociatedBaseItemID" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="RemoveAssociationFromBaseItem" Modifier="Public" Name="RemoveAssociationFromBaseItem" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy13" UserSourceName="RemoveAssociationFromBaseItem">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>DELETE FROM BaseItemAssociation
WHERE        (AssociatedBaseItemID = @associatedBaseItemID) and (BaseItemID = @baseItemID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="associatedBaseItemID" ColumnName="AssociatedBaseItemID" DataSourceName="SocialNetwork.dbo.BaseItemAssociation" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@associatedBaseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="AssociatedBaseItemID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.BaseItemAssociation" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="SocialNetwork.dbo.BaseItem" DbObjectType="Table" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="SearchAll" GetMethodModifier="Public" GetMethodName="SearchAll" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="SearchAll" UserSourceName="SearchAll">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT TOP (100) BaseItem.AverageRating, BaseItem.BaseItemID, BaseItem.CreateDate, BaseItem.Description, BaseItem.ImageURL, BaseItem.IsApproved, BaseItem.ItemType, BaseItem.LocationID, BaseItem.OwnerUserID, BaseItem.PrivacyLevel, BaseItem.SubType, BaseItem.TagList, BaseItem.Title, BaseItem.TotalRatingCount, BaseItem.TotalRatingScore, BaseItem.TotalViews, ImageURL  FROM BaseItem INNER JOIN Location ON BaseItem.LocationID = Location.LocationID WHERE (BaseItem.TagList LIKE @tagSearchList) AND (Location.SearchData LIKE @locationSearchData) ORDER BY BaseItem.AverageRating DESC</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="tagSearchList" ColumnName="TagList" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="text" DbType="AnsiString" Direction="Input" ParameterName="@tagSearchList" Precision="0" ProviderType="Text" Scale="0" Size="2147483647" SourceColumn="TagList" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="locationSearchData" ColumnName="SearchData" DataSourceName="SocialNetwork.dbo.Location" DataTypeServer="varchar(256)" DbType="AnsiString" Direction="Input" ParameterName="@locationSearchData" Precision="0" ProviderType="VarChar" Scale="0" Size="256" SourceColumn="SearchData" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="SearchByItemType" GetMethodModifier="Public" GetMethodName="SearchByItemType" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="SearchByItemType" UserSourceName="SearchByItemType">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>WITH PageTable AS
(
SELECT BaseItem.AverageRating, BaseItem.BaseItemID, BaseItem.CreateDate, 
		BaseItem.Description, BaseItem.ItemType, BaseItem.LocationID, BaseItem.OwnerUserID, 
		BaseItem.PrivacyLevel, BaseItem.SubType, BaseItem.TagList, BaseItem.Title, BaseItem.TotalRatingCount, 
		BaseItem.TotalRatingScore, BaseItem.TotalViews, IsApproved

		, ROW_NUMBER() over (ORDER BY BaseItem.AverageRating DESC) as RowID


FROM BaseItem INNER JOIN Location ON BaseItem.LocationID = Location.LocationID 
WHERE (BaseItem.ItemType = @itemType) AND 
(BaseItem.TagList LIKE @tagSearchList) AND (Location.SearchData LIKE @locationSearchData)

)

select * from PageTable
where RowID between (@startRowIndex + 1) and (@startRowIndex + @maximumRows)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@itemType" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@tagSearchList" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@locationSearchData" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@startRowIndex" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@maximumRows" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="SearchBySubItemType" GetMethodModifier="Public" GetMethodName="SearchBySubItemType" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="SearchBySubItemType" UserSourceName="SearchBySubItemType">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>WITH PageTable AS
(
SELECT BaseItem.AverageRating, BaseItem.BaseItemID, BaseItem.CreateDate, 
		BaseItem.Description, BaseItem.ItemType, BaseItem.LocationID, BaseItem.OwnerUserID, 
		BaseItem.PrivacyLevel, BaseItem.SubType, BaseItem.TagList, BaseItem.Title, BaseItem.TotalRatingCount, 
		BaseItem.TotalRatingScore, BaseItem.TotalViews, IsApproved

		, ROW_NUMBER() over (ORDER BY BaseItem.AverageRating DESC) as RowID


FROM BaseItem INNER JOIN Location ON BaseItem.LocationID = Location.LocationID 
WHERE (BaseItem.ItemType = @itemType) AND  (BaseItem.SubType = @subType) AND
(BaseItem.TagList LIKE @tagSearchList) AND (Location.SearchData LIKE @locationSearchData)

)

select * from PageTable
where RowID between (@startRowIndex + 1) and (@startRowIndex + @maximumRows)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="itemType" ColumnName="ItemType" DataSourceName="" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@itemType" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="ItemType" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="String" Direction="Input" ParameterName="@subType" Precision="0" ProviderType="NVarChar" Scale="0" Size="0" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="tagSearchList" ColumnName="TagList" DataSourceName="" DataTypeServer="text" DbType="AnsiString" Direction="Input" ParameterName="@tagSearchList" Precision="0" ProviderType="Text" Scale="0" Size="2147483647" SourceColumn="TagList" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="locationSearchData" ColumnName="SearchData" DataSourceName="" DataTypeServer="varchar(256)" DbType="AnsiString" Direction="Input" ParameterName="@locationSearchData" Precision="0" ProviderType="VarChar" Scale="0" Size="256" SourceColumn="SearchData" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@startRowIndex" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@maximumRows" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorGetMethodName="GetDataBy15" GeneratorSourceName="SearchCount" Modifier="Public" Name="SearchCount" QueryType="Scalar" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy14" UserSourceName="SearchCount">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT COUNT(*) 

FROM BaseItem INNER JOIN Location ON BaseItem.LocationID = Location.LocationID 
WHERE (BaseItem.ItemType = @itemType) AND  (BaseItem.SubType = @subType) AND
(BaseItem.TagList LIKE @tagSearchList) AND (Location.SearchData LIKE @locationSearchData)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="itemType" ColumnName="ItemType" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@itemType" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="ItemType" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="subType" ColumnName="SubType" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="varchar(50)" DbType="AnsiString" Direction="Input" ParameterName="@subType" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="SubType" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="tagSearchList" ColumnName="TagList" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="text" DbType="AnsiString" Direction="Input" ParameterName="@tagSearchList" Precision="0" ProviderType="Text" Scale="0" Size="2147483647" SourceColumn="TagList" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="locationSearchData" ColumnName="SearchData" DataSourceName="SocialNetwork.dbo.Location" DataTypeServer="varchar(256)" DbType="AnsiString" Direction="Input" ParameterName="@locationSearchData" Precision="0" ProviderType="VarChar" Scale="0" Size="256" SourceColumn="SearchData" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="SetThumbnail" Modifier="Public" Name="SetThumbnail" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy15" UserSourceName="SetThumbnail">
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>DELETE FROM ThumbnailCache WHERE BaseItemID = @baseItemID;
UPDATE [BaseItem] SET ThumbnailBits = @thumbnailBits where BaseItemID = @baseItemID</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.ThumbnailCache" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="thumbnailBits" ColumnName="ThumbnailBits" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="varbinary(MAX)" DbType="Binary" Direction="Input" ParameterName="@thumbnailBits" Precision="0" ProviderType="VarBinary" Scale="0" Size="2147483647" SourceColumn="ThumbnailBits" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="SetTotalViews" Modifier="Public" Name="SetTotalViews" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy16" UserSourceName="SetTotalViews">
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>UPDATE [BaseItem] SET [TotalViews] = @totalViews WHERE (BaseItemID = @baseItemID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="totalViews" ColumnName="TotalViews" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@totalViews" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="TotalViews" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectName="" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorGetMethodName="GetDataBy8" GeneratorSourceName="UpdateBaseItem" Modifier="Public" Name="UpdateBaseItem" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy17" UserSourceName="UpdateBaseItem">
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>UPDATE       BaseItem
SET                TagList = @tagList, LocationID = @locationID, Title = @title, Description = @description, OwnerUserID = @ownerUserID, PrivacyLevel =@privacyLevel, ImageURL = @imageURL
WHERE        (BaseItemID = @baseItemID)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="tagList" ColumnName="TagList" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="text" DbType="AnsiString" Direction="Input" ParameterName="@tagList" Precision="0" ProviderType="Text" Scale="0" Size="2147483647" SourceColumn="TagList" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="locationID" ColumnName="LocationID" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@locationID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="LocationID" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="title" ColumnName="Title" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="nvarchar(255)" DbType="String" Direction="Input" ParameterName="@title" Precision="0" ProviderType="NVarChar" Scale="0" Size="255" SourceColumn="Title" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="description" ColumnName="Description" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="ntext" DbType="String" Direction="Input" ParameterName="@description" Precision="0" ProviderType="NText" Scale="0" Size="1073741823" SourceColumn="Description" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="ownerUserID" ColumnName="OwnerUserID" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="uniqueidentifier" DbType="Guid" Direction="Input" ParameterName="@ownerUserID" Precision="0" ProviderType="UniqueIdentifier" Scale="0" Size="16" SourceColumn="OwnerUserID" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="privacyLevel" ColumnName="PrivacyLevel" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@privacyLevel" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="PrivacyLevel" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="imageURL" ColumnName="ImageURL" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="varchar(255)" DbType="AnsiString" Direction="Input" ParameterName="@imageURL" Precision="0" ProviderType="VarChar" Scale="0" Size="255" SourceColumn="ImageURL" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
              <DbSource ConnectionRef="SocialNetworkConnectionString (Settings)" DbObjectType="Unknown" GenerateShortCommands="true" GeneratorSourceName="VerifyBaseItemHasBits" Modifier="Public" Name="VerifyBaseItemHasBits" QueryType="Scalar" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy18" UserSourceName="VerifyBaseItemHasBits">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT COUNT(*) FROM BaseItem WHERE (BaseItemID = @baseItemID) AND ((ThumbnailBits IS NOT NULL ) OR (ImageURL is not NULL))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="baseItemID" ColumnName="BaseItemID" DataSourceName="SocialNetwork.dbo.BaseItem" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@baseItemID" Precision="0" ProviderType="Int" Scale="0" Size="4" SourceColumn="BaseItemID" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </Sources>
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="BaseItemDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="BaseItemDataSet" msprop:Generator_DataSetName="BaseItemDataSet">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="BaseItem" msprop:Generator_UserTableName="BaseItem" msprop:Generator_RowDeletedName="BaseItemRowDeleted" msprop:Generator_RowChangedName="BaseItemRowChanged" msprop:Generator_RowClassName="BaseItemRow" msprop:Generator_RowChangingName="BaseItemRowChanging" msprop:Generator_RowEvArgName="BaseItemRowChangeEvent" msprop:Generator_RowEvHandlerName="BaseItemRowChangeEventHandler" msprop:Generator_TableClassName="BaseItemDataTable" msprop:Generator_TableVarName="tableBaseItem" msprop:Generator_RowDeletingName="BaseItemRowDeleting" msprop:Generator_TablePropName="BaseItem">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="BaseItemID" msdata:ReadOnly="true" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="BaseItemID" msprop:Generator_ColumnVarNameInTable="columnBaseItemID" msprop:Generator_ColumnPropNameInRow="BaseItemID" msprop:Generator_ColumnPropNameInTable="BaseItemIDColumn" type="xs:int" />
              <xs:element name="ItemType" msprop:Generator_UserColumnName="ItemType" msprop:Generator_ColumnVarNameInTable="columnItemType" msprop:Generator_ColumnPropNameInRow="ItemType" msprop:Generator_ColumnPropNameInTable="ItemTypeColumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="TagList" msprop:Generator_UserColumnName="TagList" msprop:Generator_ColumnVarNameInTable="columnTagList" msprop:Generator_ColumnPropNameInRow="TagList" msprop:Generator_ColumnPropNameInTable="TagListColumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="LocationID" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="LocationID" msprop:Generator_ColumnVarNameInTable="columnLocationID" msprop:Generator_ColumnPropNameInRow="LocationID" msprop:Generator_ColumnPropNameInTable="LocationIDColumn" type="xs:string" />
              <xs:element name="TotalViews" msprop:Generator_UserColumnName="TotalViews" msprop:Generator_ColumnVarNameInTable="columnTotalViews" msprop:Generator_ColumnPropNameInRow="TotalViews" msprop:Generator_ColumnPropNameInTable="TotalViewsColumn" type="xs:int" />
              <xs:element name="TotalRatingScore" msprop:Generator_UserColumnName="TotalRatingScore" msprop:Generator_ColumnVarNameInTable="columnTotalRatingScore" msprop:Generator_ColumnPropNameInRow="TotalRatingScore" msprop:Generator_ColumnPropNameInTable="TotalRatingScoreColumn" type="xs:double" />
              <xs:element name="TotalRatingCount" msprop:Generator_UserColumnName="TotalRatingCount" msprop:Generator_ColumnVarNameInTable="columnTotalRatingCount" msprop:Generator_ColumnPropNameInRow="TotalRatingCount" msprop:Generator_ColumnPropNameInTable="TotalRatingCountColumn" type="xs:int" />
              <xs:element name="AverageRating" msdata:ReadOnly="true" msprop:Generator_UserColumnName="AverageRating" msprop:Generator_ColumnVarNameInTable="columnAverageRating" msprop:Generator_ColumnPropNameInRow="AverageRating" msprop:Generator_ColumnPropNameInTable="AverageRatingColumn" type="xs:double" minOccurs="0" />
              <xs:element name="Title" msprop:Generator_UserColumnName="Title" msprop:Generator_ColumnVarNameInTable="columnTitle" msprop:Generator_ColumnPropNameInRow="Title" msprop:Generator_ColumnPropNameInTable="TitleColumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="255" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Description" msprop:Generator_UserColumnName="Description" msprop:Generator_ColumnVarNameInTable="columnDescription" msprop:Generator_ColumnPropNameInRow="Description" msprop:Generator_ColumnPropNameInTable="DescriptionColumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="1073741823" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="OwnerUserID" msdata:DataType="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" msprop:Generator_UserColumnName="OwnerUserID" msprop:Generator_ColumnVarNameInTable="columnOwnerUserID" msprop:Generator_ColumnPropNameInRow="OwnerUserID" msprop:Generator_ColumnPropNameInTable="OwnerUserIDColumn" type="xs:string" />
              <xs:element name="CreateDate" msprop:Generator_UserColumnName="CreateDate" msprop:Generator_ColumnVarNameInTable="columnCreateDate" msprop:Generator_ColumnPropNameInRow="CreateDate" msprop:Generator_ColumnPropNameInTable="CreateDateColumn" type="xs:dateTime" />
              <xs:element name="SubType" msprop:Generator_UserColumnName="SubType" msprop:Generator_ColumnVarNameInTable="columnSubType" msprop:Generator_ColumnPropNameInRow="SubType" msprop:Generator_ColumnPropNameInTable="SubTypeColumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PrivacyLevel" msprop:Generator_UserColumnName="PrivacyLevel" msprop:Generator_ColumnVarNameInTable="columnPrivacyLevel" msprop:Generator_ColumnPropNameInRow="PrivacyLevel" msprop:Generator_ColumnPropNameInTable="PrivacyLevelColumn" type="xs:int" />
              <xs:element name="IsApproved" msprop:Generator_UserColumnName="IsApproved" msprop:Generator_ColumnPropNameInRow="IsApproved" msprop:Generator_ColumnVarNameInTable="columnIsApproved" msprop:Generator_ColumnPropNameInTable="IsApprovedColumn" type="xs:boolean" />
              <xs:element name="ImageURL" msprop:Generator_UserColumnName="ImageURL" msprop:Generator_ColumnVarNameInTable="columnImageURL" msprop:Generator_ColumnPropNameInRow="ImageURL" msprop:Generator_ColumnPropNameInTable="ImageURLColumn" type="xs:string" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:BaseItem" />
      <xs:field xpath="mstns:BaseItemID" />
    </xs:unique>
  </xs:element>
</xs:schema>